﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GrayParrot.Data.EntityFramework
{
    public static class UnitOfWorkExtensions
    {
        public static UnitOfWork CreateUnitOfWork<TContext>(this DbContext<TContext> context, IsolationLevel isolationLevel = IsolationLevel.ReadCommitted)
            where TContext : DbContext, new()
        {
            var m_c = context.BuildContext();
            UnitOfWork retValue = new UnitOfWork(m_c);

            return retValue;
        }
    }
}
